/**
 * 
 */
package com.et114.modules.products.params;

import java.util.List;

import com.et114.components.simpletable.DataList;
import com.et114.components.simpletable.dao.SimpleTableDAOImpl;

/*
 * @author guanhw
 */
public class ParamsDao extends SimpleTableDAOImpl {
	public DataList getParamTypes( ParamType vo  ) throws Exception {
		return queryListDataList ( vo  , "getParamType" ) ; 
	} 
	
	@ SuppressWarnings ( "unchecked" )
	public List< ParamType > getParamTypeList( ParamType vo ) throws Exception {
		return queryList( vo , "getParamTypeNPage" ) ; 
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< ParamType > getRootParamType( ParamType vo ) throws Exception { 
		return  queryList( vo , "getRootParamType" ) ; 
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< ParamType > getChildsByTypeId( Long parentId ) throws Exception {
		return queryList( parentId , "getChildsByTypeId" ) ;
	}
	
	public Long saveParamType( ParamType vo ) throws Exception {
		return ( Long )insert( vo , "insertParamType" ) ; 
	}
	
	public ParamType getParamTypeById( Long id ) throws Exception {
		return ( ParamType ) load( id , "getParamTypeById" ) ; 
	}
	
	public void updateParamType( ParamType vo  )  throws Exception {
		update( vo , "updateParamType" ) ;
	}
	
	public void removeParamType( Long id ) throws Exception {
		delete( id , "removeParamType" ) ; 
	}
	
	public void removeParamTypeByParentId( Long parentId ) throws Exception {
		delete( parentId , "removeParamTypeByParentId" ) ;
	}
	
	public DataList getParamValues( ParamValue vo ) throws Exception {
		return queryListDataList( vo , "getParamValue" )  ; 
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List < ParamValue > getParamValueList( ParamValue vo ) throws Exception {
		return queryList( vo , "getParamValueNPage"  ) ;
	}
	
	public ParamValue getParamValueById( Long id ) throws Exception {
		return ( ParamValue ) load( id , "getParamValueById" ) ; 
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< ParamValue > getParamValuesByTypeId( Long typeId  ) throws Exception {
		return queryList( typeId , "getParamValuesByTypeId" ) ;
	}
	
	/*
	@ SuppressWarnings ( "unchecked" )
	public List< ParamValue > getParamValuesByType( ParamValue vo ) throws Exception {
		return queryList( vo , "getParamValuesByType" ) ;
	}*/
	
	public Long saveParamValue( ParamValue vo ) throws Exception { 
		return ( Long )insert( vo , "insertParamValue" ) ; 
	}
	
	public void updateParamValue( ParamValue vo ) throws Exception {
		update( vo , "updateParamValue" ) ;
	}
	
	public void removeParamValue( Long id ) throws Exception {
		delete( id , "removeParamValue" ) ; 
	}
	
	public void removeParamValueByTypeId(  Long typeId ) throws Exception { 
		delete( typeId , "removeParamValueByTypeId" ) ;
	}
}
